package net.csdn.business.common.domain.mirror;

import cn.hutool.core.annotation.Alias;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.csdn.business.common.domain.vo.OrgInfoVo;
import net.csdn.business.common.domain.vo.UserVo;

import java.io.Serializable;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class MyGithubDto {
    private String token;
    private String thirdUsername;
    private int totalCount = 0;
    private int importCount = 0;
    private int notImportCount = 0;
    private List<Repository> items;
    private UserVo userInfo;
    private List<OrgInfoVo> orgInfos;
    private int type = 0;

    private int thirdTotalPage;
    private List<Namespace> namespaces;
    private String orgMessage;

    @Data
    public static class Repository implements Serializable {
        private long id;
        @JsonProperty("full_name")
        private String fullName;
        private String name;
        private String description;
        private String homepage;
        @JsonProperty("html_url")
        private String htmlUrl;
        private String visibility;
        @JsonProperty("default_branch")
        private String defaultBranch;
        private long size;
        @JsonProperty("private")
        @Alias("private")
        private Boolean _private;
        // 追加
        private boolean imported = false;
        private String importedPath;
        private String importedUrl;
        private String importedStatus = "未导入";
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Namespace implements Serializable {
        private long id;
        private String type;
        private String name;
        private String path;
        private String htmlUrl;

        private String login; // github
    }
}